/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.brain.entity;

import com.thinkgem.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 用户日状态Entity
 * @author 程展峰
 * @version 2021-09-18
 */
public class BUserDailystatusData extends DataEntity<BUserDailystatusData> {
	
	private static final long serialVersionUID = 1L;
	 User user;		// user_id
	 String userName;		// user_name
	 String tenantId;		// tenant_id
	 Date date;		// 状态日期
	 String isallowrank;		// 是否允许参加排位 0 否 1 是
	 String rankMessage;		// 排位相关信息
	 String isallowpratice;		// 是否允许参加练习 0 否 1 是
	 Integer rankRemaintimes;		// 排位剩余局数 null为无限
	 Integer praticeRemaintimes;		// 练习剩余局数 null为无限
	 String praticeMessahe;		// 练习相关信息
	 Integer praticeTimes;		// 练习进行次数
	 Integer rankTimes;		// 排位进行次数
	 Integer rankAcrossTimes;		// 排位通过次数
	 Integer rankFailureTimes;		// 排位失败次数
	 Integer praticeAcrossTimes;		    // 練習通过次数
	 Integer praticeFailureTimes;		// 练习失败次数
	 Integer status;		// 当前用户状态  -2:暂停服务 -1:用户停止 1 :下线 2:在线  3:进行练习 (这个状态未实现)






	private BUserRankData starNum;  //当前用户星星数

	public BUserRankData getStarNum() {
		return starNum;
	}

	public Integer setStarNumAdd(Integer count) {
		this.starNum.setRankStar( this.starNum.getRankStar()+count);

		return this.starNum.getRankStar().intValue();
	}
	public void setStarNum(BUserRankData starNum) {
		this.starNum =starNum;
	}

	public Integer setStarNumSubtract(Integer count) {
		long num=this.starNum.getRankStar()-count;
		this.starNum.setRankStar(num<0?0:num);
		return this.starNum.getRankStar().intValue();
	}

	public BUserDailystatusData() {
		super();
	}

	public BUserDailystatusData(String id){
		super(id);
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=0, max=255, message="user_name长度必须介于 0 和 255 之间")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@Length(min=0, max=64, message="tenant_id长度必须介于 0 和 64 之间")
	public String getTenantId() {
		return tenantId;
	}

	public void setTenantId(String tenantId) {
		this.tenantId = tenantId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	
	@Length(min=1, max=1, message="是否允许参加排位 0 否 1 是长度必须介于 1 和 1 之间")
	public String getIsallowrank() {
		return isallowrank;
	}

	public void setIsallowrank(String isallowrank) {
		this.isallowrank = isallowrank;
	}
	
	@Length(min=0, max=255, message="排位相关信息长度必须介于 0 和 255 之间")
	public String getRankMessage() {
		return rankMessage;
	}

	public void setRankMessage(String rankMessage) {
		this.rankMessage = rankMessage;
	}
	
	@Length(min=1, max=1, message="是否允许参加练习 0 否 1 是长度必须介于 1 和 1 之间")
	public String getIsallowpratice() {
		return isallowpratice;
	}

	public void setIsallowpratice(String isallowpratice) {
		this.isallowpratice = isallowpratice;
	}
	
	public Integer getRankRemaintimes() {
		return rankRemaintimes;
	}

	public void setRankRemaintimes(Integer rankRemaintimes) {
		this.rankRemaintimes = rankRemaintimes;
	}
	
	public Integer getPraticeRemaintimes() {
		return praticeRemaintimes;
	}

	public void setPraticeRemaintimes(Integer praticeRemaintimes) {
		this.praticeRemaintimes = praticeRemaintimes;
	}
	
	@Length(min=0, max=255, message="练习相关信息长度必须介于 0 和 255 之间")
	public String getPraticeMessahe() {
		return praticeMessahe;
	}

	public void setPraticeMessahe(String praticeMessahe) {
		this.praticeMessahe = praticeMessahe;
	}
	
	public Integer getPraticeTimes() {
		return praticeTimes;
	}

	public void setPraticeTimes(Integer praticeTimes) {
		this.praticeTimes = praticeTimes;
	}
	
	public Integer getRankTimes() {
		return rankTimes;
	}

	public void setRankTimes(Integer rankTimes) {
		this.rankTimes = rankTimes;
	}
	
	public Integer getRankAcrossTimes() {
		return rankAcrossTimes;
	}

	public void setRankAcrossTimes(Integer rankAcrossTimes) {
		this.rankAcrossTimes = rankAcrossTimes;
	}
	
	public Integer getRankFailureTimes() {
		return rankFailureTimes;
	}

	public void setRankFailureTimes(Integer rankFailureTimes) {
		this.rankFailureTimes = rankFailureTimes;
	}
	
	public Integer getPraticeAcrossTimes() {
		return praticeAcrossTimes;
	}

	public void setPraticeAcrossTimes(Integer praticeAcrossTimes) {
		this.praticeAcrossTimes = praticeAcrossTimes;
	}
	
	public Integer getPraticeFailureTimes() {
		return praticeFailureTimes;
	}

	public void setPraticeFailureTimes(Integer praticeFailureTimes) {
		this.praticeFailureTimes = praticeFailureTimes;
	}
	
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
}